package it.polito.connectedcar.message;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Queues factory to make available a set of Messages' queues used by
 * potentially many components in the system.
 * 
 * @author Nicola Aresta
 * 
 */
public class MessageQueueFactory {

	private BlockingQueue<OutgoingMessage> genericMessageQeue;
	private BlockingQueue<VehicleFromTCCMessage> TCCMessageQueue;
	private BlockingQueue<VehicleFromVehicleMessage> vehiclesMessageQueue;

	public MessageQueueFactory() {
		genericMessageQeue = new LinkedBlockingQueue<OutgoingMessage>();
		TCCMessageQueue = new LinkedBlockingQueue<VehicleFromTCCMessage>();
		vehiclesMessageQueue = new LinkedBlockingQueue<VehicleFromVehicleMessage>();
	}

	public BlockingQueue<OutgoingMessage> getToBeSentMessageQueue() {
		return genericMessageQeue;
	}

	public BlockingQueue<VehicleFromTCCMessage> getTCCMessageQueue() {
		return TCCMessageQueue;
	}

	public BlockingQueue<VehicleFromVehicleMessage> getVehiclesMessageQueue() {
		return vehiclesMessageQueue;
	}
}
